package com.ddone.demo.bean;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Past;
import java.util.Date;

/**
 * @author ddone
 * @date 2024/3/23-18:09
 */
@Data
public class ValidUser {
    @NotEmpty(message = "账号不能为空")
    private String account;
    @Length(min = 6,max = 10,message = "密码长度 6-10位")
    private String password;
    @Range(min = 18,max = 30,message = "年龄18~30")
    private int age;
    @Email(message = "需要邮箱格式")
    private String email;
    private String info;
    @Past(message = "生日需要在过去")
    private Date birthday;
    @Digits(integer = 3,fraction = 1,message = "3为整数,1为小数")
    private Double height;
}
